package com.party.business.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.party.business.domain.TLbImage;
import com.party.business.mapper.TLbImageMapper;
import com.party.business.service.ITLbImageService;
import com.party.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 轮播图Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-13
 */
@Service
public class TLbImageServiceImpl extends ServiceImpl<TLbImageMapper, TLbImage> implements ITLbImageService {
    @Autowired
    private TLbImageMapper tLbImageMapper;

    /**
     * 查询轮播图
     *
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public TLbImage selectTLbImageById(String id) {
        return tLbImageMapper.selectTLbImageById(id);
    }

    /**
     * 查询轮播图列表
     *
     * @param tLbImage 轮播图
     * @return 轮播图
     */
    @Override
    public List<TLbImage> selectTLbImageList(TLbImage tLbImage) {
        return tLbImageMapper.selectTLbImageList(tLbImage);
    }

    /**
     * 新增轮播图
     *
     * @param tLbImage 轮播图
     * @return 结果
     */
    @Override
    public int insertTLbImage(TLbImage tLbImage) {
        tLbImage.setCreateTime(DateUtils.getNowDate());
        return tLbImageMapper.insertTLbImage(tLbImage);
    }

    /**
     * 修改轮播图
     *
     * @param tLbImage 轮播图
     * @return 结果
     */
    @Override
    public int updateTLbImage(TLbImage tLbImage) {
        tLbImage.setUpdateTime(DateUtils.getNowDate());
        return tLbImageMapper.updateTLbImage(tLbImage);
    }

    /**
     * 批量删除轮播图
     *
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteTLbImageByIds(String[] ids) {
        return tLbImageMapper.deleteTLbImageByIds(ids);
    }

    /**
     * 删除轮播图信息
     *
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteTLbImageById(String id) {
        return tLbImageMapper.deleteTLbImageById(id);
    }
}
